package com.liqi.system.service.impl;

import java.util.List;
import com.liqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.liqi.system.mapper.SysItemsMapper;
import com.liqi.system.domain.SysItems;
import com.liqi.system.service.ISysItemsService;

/**
 * 事项Service业务层处理
 * 
 * @author fsm
 * @date 2022-02-22
 */
@Service
public class SysItemsServiceImpl implements ISysItemsService 
{
    @Autowired
    private SysItemsMapper sysItemsMapper;

    /**
     * 查询事项
     * 
     * @param id 事项主键
     * @return 事项
     */
    @Override
    public SysItems selectSysItemsById(Long id)
    {
        return sysItemsMapper.selectSysItemsById(id);
    }

    /**
     * 查询事项列表
     * 
     * @param sysItems 事项
     * @return 事项
     */
    @Override
    public List<SysItems> selectSysItemsList(SysItems sysItems)
    {
        return sysItemsMapper.selectSysItemsList(sysItems);
    }

    /**
     * 新增事项
     * 
     * @param sysItems 事项
     * @return 结果
     */
    @Override
    public int insertSysItems(SysItems sysItems)
    {
        sysItems.setCreateTime(DateUtils.getNowDate());
        return sysItemsMapper.insertSysItems(sysItems);
    }

    /**
     * 修改事项
     * 
     * @param sysItems 事项
     * @return 结果
     */
    @Override
    public int updateSysItems(SysItems sysItems)
    {
        sysItems.setUpdateTime(DateUtils.getNowDate());
        return sysItemsMapper.updateSysItems(sysItems);
    }

    /**
     * 批量删除事项
     * 
     * @param ids 需要删除的事项主键
     * @return 结果
     */
    @Override
    public int deleteSysItemsByIds(Long[] ids)
    {
        return sysItemsMapper.deleteSysItemsByIds(ids);
    }

    /**
     * 删除事项信息
     * 
     * @param id 事项主键
     * @return 结果
     */
    @Override
    public int deleteSysItemsById(Long id)
    {
        return sysItemsMapper.deleteSysItemsById(id);
    }
}
